# 页面类
import time
from Unit_01.Base import Base
from selenium.webdriver.common.by import By
class Page(Base):
    # 定位器
    # 输入框的定位
    search_loc=(By.ID,'kw')

    baidu_loc=(By.ID,'su')

    shezhi_loc=(By.NAME,'tj_settingicon')

    gaoji_loc=(By.CLASS_NAME,'set')

    digaoshezhi=(By.XPATH,'//*[@id="wrapper"]/div[5]/div/div/ul/li[2]')

    # 页面元素的封装
    # 对输入框的定位进行输入操作
    def search(self):
        self.find_element(self.search_loc).send_keys("web端自动化测试")
    # 点击搜索按钮
    def baidubtn(self):
        self.find_element(self.baidu_loc).click()
    # 双击
    def shuangloc(self):
        self.col_shuang(self.search_loc)
    # 复制
    def fuzhiloc(self):
        self.col_fuzhi(self.search_loc)
    # 设置
    def shezhi(self):
        self.find_element(self.shezhi_loc).click()
    # 高级搜索
    def gaoji(self):
        self.find_element(self.gaoji_loc).click()
    # 点高级搜索
    def digaoji(self):
        self.find_element(self.digaoshezhi).click()
    # 业务逻辑
    def baidu_luoji(self):
        self.open_url('https://www.baidu.com/')
        # time.sleep(2)
        self.search()
        # time.sleep(2)
        self.baidubtn()
        # time.sleep(2)
        self.shuangloc()
        # time.sleep(2)
        self.fuzhiloc()
        # time.sleep(2)
        self.shezhi()
        # time.sleep(2)
        self.gaoji()
        # time.sleep(2)
        self.digaoji()
        time.sleep(2)



